function FindTheSmallestAndTheLargestPropertiesLexicographically(objectForInvestigate)
{
    var smallest = Object.keys(objectForInvestigate)[0];
    var largest = Object.keys(objectForInvestigate)[0];

    for (var prop in objectForInvestigate)
    {
        if (prop < smallest)
        {
            smallest = prop;
        }

        if (prop > largest)
        {
            largest = prop;
        }
    }

    console.log(smallest);
    console.log(largest);
}

FindTheSmallestAndTheLargestPropertiesLexicographically(window);
FindTheSmallestAndTheLargestPropertiesLexicographically(window.document);
FindTheSmallestAndTheLargestPropertiesLexicographically(window.navigator);